package com.shanjupay.merchant.convert;

import com.shanjupay.merchant.api.dto.AppDTO;
import com.shanjupay.merchant.entity.App;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author whb
 * @create 2021-12-04 11:31
 * @desciption app应用DTO和entity数据类型转换类
 */
@Mapper //对象属性的映射
public interface AppCovert {
    //转换类实例
    AppCovert INSTANCE = Mappers.getMapper(AppCovert.class);

    /**
     * entity转换成dto
     * @param app
     * @return
     */
    AppDTO entity2dto(App app);

    /**
     * dto转换成entity
     * @param appDTO
     * @return
     */
    App dto2entity(AppDTO appDTO);

    /**
     * entity List集合转换成dto List集合
     * @param appList
     * @return
     */
    List<AppDTO> entityList2dtoList(List<App> appList);
}
